home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 December / december_2001.iso / Internet Programs / HTML Webmaster 2.0 / _SETUP.1 / Parsing.cod < prev    next >
Encoding:
Text File  |  2001-02-16  |  1.3 KB  |  45 lines

  1.  
  2. <%
  3.  
  4. Function GetLinEle(Origin , Sep1, Sep2)
  5. 'Parses a Line of text
  6. '<Sep1>Finds this text<Sep2>
  7. Dim Bpos
  8. Dim Epos
  9. Dim bDone
  10. bdone = true
  11. Bpos = InStr(1, Origin, Sep1, vbBinaryCompare)
  12. If Bpos = 0 Then bdone = False
  13. Epos = InStr(1, Origin, Sep2, vbBinaryCompare)
  14. If epos = 0 Then bdone = False
  15. Bpos = Bpos + Len(Sep1)
  16. If  bdone = True then
  17. GetLinEle = Mid(Origin, Bpos, Epos - Bpos)
  18. else
  19. If  bdone = False Then
  20. GetLinEle  = ""
  21. end if
  22. end if
  23. End Function
  24.  
  25.  
  26. Function parseoneline (GetTheStr)
  27. 'parses normal text and returns HTMl formatted
  28.     Start = 1
  29.     whereis = 1
  30.     NewHTMLStringWithBreaks = ""
  31.     RemaindingHTMLString = GetTheStr        
  32.     RemaindingHTMLString = RemaindingHTMLString & chr(13)
  33.     do until (whereis = 0)
  34.         Whereis = InStr (1, RemaindingHTMLString, Chr(13))
  35.         Chr13Position = Whereis - 1    
  36.         LineOfHTMLBeforeNextChr13 = Mid(RemaindingHTMLString, 1 , Whereis)
  37.         Chr13Position = Whereis + 2
  38.         LineOfHTMLAfterNextChr13 = Mid(RemaindingHTMLString, Chr13Position, Len(RemaindingHTMLString))
  39.         RemaindingHTMLString = LineOfHTMLAfterNextChr13
  40.         NewHTMLStringWithBreaks = NewHTMLStringWithBreaks & LineOfHTMLBeforeNextChr13 & "<br>"
  41.     loop
  42.     Response.Write("<font size=" & chr(34) & "2"& chr(34) &  ">" & NewHTMLStringWithBreaks & "</font>")
  43. End Function
  44.  
  45. %>